package com.jumi.microservice.constant;

import com.jumi.microservice.common.exception.BusinessExceptionAssert;

/**
 * - - - - - - - - - - - - - - -
 *
 * @author liuz
 * @date 2020/7/18 17:35
 * ToDoSomeThing
 * - - - - - - - - - - - - - - -
 */
public enum ExceptionEnum implements BusinessExceptionAssert {

    /**
     * 返回状态码集
     */
    FAIL(500, "获取数据失败"),
    FAIL_CHANGE(500,"数据转换异常"),
    FAIL_ID_NULL(500, "数据id为空"),
    FAIL_NULL(500, "获取数据为空"),
    FAIL_STATUS(500,"该数据为启用状态,不可删除"),
    FAIL_BIND_USER(500,"角色:[{}]已绑定到用户,不可删除"),
    FAIL_MENU_EXIST(500,"该权限标识已存在"),
    FAIL_HAS_CHILD(500,"该菜单还存在下级菜单，不能删除"),
    FAIL_HAS_ROLE(500,"该菜单已绑定角色，不能删除"),
    FAIL_UID_NULL(500,"检查请求头中用户ID是否存在"),
    FAIL_STATUS_ROLES(500,"角色:[{}]为启用状态,不可删除"),
    FAIL_ROLES_RXIST(500,"该角色名已存在"),
    FAIL_DEPARTMENT_DEL1(500,"根目录不能删除"),
    FAIL_DEPARTMENT_DEL2(500,"启用状态下的部门，不能删除"),
    FAIL_DEPARTMENT_DEL3(500,"该部门下有下级部门，不能删除"),
    FAIL_DEPARTMENT_DEL4(500,"该部门下有账号关联，不能删除")
    ;

    private final Integer code;

    private final String message;

    ExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }}
